package util;

import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * 
 * @author Melectrian
 *This class provides the interface that defines the methods used
 *for remote invocation during the client to server communication.
 *
 */

public interface VersiRemote extends Remote {
	
    /**
     * Carries out the required procedures for full lock of the file on the server.
     * Involves checking current file state, a physical lock and a database edit.
     * @param filename name of the local file
     * @param username name of the user willing to lock the file
     * @return true for success, false for failure
     */
	
public boolean checkout(String filename, String username) throws RemoteException;

/**
 * Carries out the required procedures for a complete commit of a file.
 * @param filename name of a local file
 * @param username name of the committing user
 * @return true for success, false for failure
 */

public boolean checkin(String filename, String username) throws RemoteException;

/**
 * Checks if a local file is in conflict with its remote version.
 * @param filename name of a local file
 * @param hash MD5 checksum of the local file
 * @param lastSave UNIX time of the last save of the local file
 * @return 0 for identical files, 1 for different files with no conflict, 2 for conflict
 */

int checkForConflict(String filename, String hash, long lastSave) throws RemoteException;

/**
 * Test method please ignore.
 * @return A String for client testing.)
 */
public String testMethodPleaseIgnore() throws RemoteException;
}
